package cn.bonoon.kernel.util;

/**
 * 
 * @author jackson
 *
 */
public abstract class ItemSortable implements OrderSortable {

	protected String id;
	
	protected String name;
	
	protected int ordinal;
	
	public final String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public void setOrdinal(int ordinal) {
		this.ordinal = ordinal;
	}

	public int getOrdinal() {
		return ordinal;
	}

	@Override
	public int compareTo(OrderSortable o) {
		return ordinal - o.getOrdinal();
	}
}
